package org.apache.flink.runtime.resourceprovider;

import org.apache.flink.runtime.registration.RegistrationResponse;
import org.apache.flink.runtime.resourcemanager.ResourceManager;

/** Rejection response from the {@link ResourceManager} for the {@link ResourceProvider}. */
public class ResourceProviderRegistrationRejection extends RegistrationResponse.Rejection {
    private static final long serialVersionUID = -7447810107639038319L;

    private final String reason;

    public ResourceProviderRegistrationRejection(String reason) {
        this.reason = reason;
    }

    public String getReason() {
        return reason;
    }

    @Override
    public String toString() {
        return "Rejected TaskExecutor registration at the ResourceManager because: " + reason;
    }
}
